package com.neusoft.controller;

import com.neusoft.pojo.SysDept;
import com.neusoft.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//让普通类编程Servlet类
@RestController
@RequestMapping("/dept")
@CrossOrigin
public class SysDeptController {

    @Autowired
    ISysDeptService sysDeptService;

    @RequestMapping("list")
    public java.util.List<SysDept> list(SysDept sysDept){
        return sysDeptService.sysDeptList(sysDept);
    }

    @RequestMapping("insert")
    public boolean insert(SysDept dept){
        System.out.println(dept.getDeptName()+","+dept.getParentId());
        return sysDeptService.sysDeptInsert(dept);
    }
}
